home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / windows / pcbrd.zip / PCBLOGON.WAS next >
Text File  |  1992-06-27  |  5KB  |  208 lines

  1. ; Script to log on to a BBS running PCBoard.
  2. ;*************************************************************************
  3. ;***
  4. ;***    module          : pcblogon.was
  5. ;***
  6. ;***    program          : ProComm Plus for Windows
  7. ;***
  8. ;***    target system :    IBM-PC or compatible running Microsoft Windows
  9. ;***            3.0 or later, and ProComm Plus for Windows 1.0
  10. ;***            or later.
  11. ;***
  12. ;***    purpose          :    script to log on to a BBS running PCBoard.
  13. ;***            assumes that script is linked to entry in dialing
  14. ;***            directory.
  15. ;***
  16. ;***    notes          : Copyright (c) 1992, Jeff Thomson
  17. ;***            All rights reserved.
  18. ;***
  19. ;***    language      : Windows ASPECT
  20. ;***
  21. ;***    version          :      $Author: jkt $
  22. ;***    control            $Date: 92/06/24 21:47:04 $
  23. ;***            $Revision: 1.0 $
  24. ;***               $State: Exp $
  25. ;***              $Source: c:/comm/prowin/aspect/rcs/pcblogon.was $
  26. ;***                 $Log:    pcblogon.was $
  27. ;***            Revision 1.0  92/06/24  21:47:04  jkt
  28. ;***            Place under version control.
  29. ;***            
  30. ;***
  31. ;***    history          :
  32. ;***
  33. ;***    date        authors        comments
  34. ;***
  35. ;***    14jun1992    jeff thomson    new code; ported from pcboard.slt.
  36. ;***    15jun1992    jeff thomson    fixed bug w/ handling multiple
  37. ;***                    question marks in prompts.
  38. ;***    27jun1992    jeff thomson    add copyright notice.
  39. ;***
  40. ;*************************************************************************
  41.  
  42. integer bExitFlag            ; flag indicating that it's time
  43.                     ; to exit main.
  44.  
  45. proc main
  46.  
  47.     bExitFlag = 0            ; initialize exit flag.
  48.     when target 0 "?" call getprompt    ; wait for "?" indicating prompt.
  49.  
  50.     while ( $CARRIER == 0 )        ; wait for CD to be asserted.
  51.     endwhile
  52.  
  53.     ;***
  54.     ;***    sit & spin while the events happen.
  55.     ;***
  56.  
  57.     while ( $CARRIER ) && ( bExitFlag == 0 )
  58.     endwhile
  59.  
  60.     clearwhen target 0
  61.  
  62. endproc
  63.  
  64. ;*************************************************************************
  65. ;***
  66. ;***    function      : getprompt
  67. ;***
  68. ;***    purpose          : determines which prompt occurred and issues
  69. ;***            appropriate response.
  70. ;***
  71. ;***    sample call   :    when target 0 "?" call getprompt
  72. ;***
  73. ;***    inputs          : none.
  74. ;***
  75. ;***    returns          : none.
  76. ;***
  77. ;***    notes          :    none.
  78. ;***
  79. ;*************************************************************************
  80.  
  81. proc getprompt
  82.  
  83.     string  szPrompt            ; buffer for line containing
  84.                     ; prompt.
  85.  
  86.     integer nBegin            ; offset of beginning of keyword.
  87.     integer nEnd            ; offset of end of keyword.
  88.     integer cQCount            ; number of ?s found in prompt.
  89.  
  90.     termgets $ROW 0 szPrompt $COL    ; read line w/ prompt from screen
  91.  
  92.     ;***
  93.     ;***    since there is a possibility of there being more than one
  94.     ;***    question mark in a prompt, extract the portion of the string
  95.     ;***    containing the last question mark (since it contains the
  96.     ;***    keyword of interest to us).
  97.     ;***
  98.  
  99.     strsearch szPrompt "?" cQCount    ; find how many ?s there are.
  100.  
  101.     while cQCount > 1
  102.  
  103.     strfind szPrompt "?" nEnd    ; find end of keyword.
  104.     nEnd = nEnd + 1
  105.     substr szPrompt szPrompt nEnd $COL
  106.     cQCount = cQCount - 1
  107.  
  108.     endwhile
  109.  
  110.     strfind szPrompt "?" nEnd        ; find end of keyword.
  111.     substr szPrompt szPrompt 0 nEnd    ; strip everything after "?"
  112.  
  113.     ;***
  114.     ;***    grab the last token in the string.
  115.     ;***
  116.  
  117.     nBegin = 0
  118.  
  119.     while strfind szPrompt " " nBegin    ; find next space
  120.  
  121.     nBegin = nBegin + 1
  122.     substr szPrompt szPrompt nBegin nEnd    ; grab everything after space
  123.  
  124.     endwhile
  125.  
  126.     ;***
  127.     ;***    decide what to do...
  128.     ;***
  129.  
  130.     switch szPrompt
  131.  
  132.     case "change"            ; "Enter Language # to use (Enter)=no change?"
  133.  
  134.         transmit "^M"
  135.  
  136.     endcase
  137.  
  138.     case "(Enter)=no"        ; "Do you want color graphics (Enter)=no?"
  139.  
  140.         transmit "n^M"
  141.  
  142.     endcase
  143.  
  144.     case "No"            ; "Do you want Color? Y=Yes, N or Enter = No?"
  145.  
  146.         transmit "n^M"
  147.  
  148.     endcase
  149.  
  150.     case "name"            ; "What is your first name?"
  151.                     ; "Enter your first name?"
  152.         transmit $USERID
  153.         transmit "^M"
  154.  
  155.     endcase
  156.  
  157.     case "echo)"            ; "Password (Dots will echo)?"
  158.  
  159.         transmit $PASSWORD
  160.         transmit "^M"
  161.  
  162.     endcase
  163.  
  164.     case "More"            ; "(H)elp, More?"
  165.  
  166.         transmit "n^M"
  167.  
  168.     endcase
  169.  
  170.     case "(Enter)=More"        ; "Help, NS, N=Stop, (Enter)=More?"
  171.  
  172.         transmit "n^M"
  173.  
  174.     endcase
  175.  
  176.     case "continue"            ; "Press (Enter) to continue?"
  177.  
  178.         transmit "^M"
  179.  
  180.     endcase
  181.  
  182.     case "(Enter)=yes"        ; "Scan message Base Since 'Last Read' (Enter)=yes?"
  183.  
  184.         transmit "n^M"
  185.  
  186.     endcase
  187.  
  188.  
  189.     case "Yes"            ; "Scan Message Base Since 'Last Read'? N=No, Enter = Yes?"
  190.  
  191.         transmit "n^M"
  192.  
  193.     endcase
  194.  
  195.     case "Command"            ; "Main Board Command?"
  196.                     ; "Channel 1 Command?"
  197.         bExitFlag = 1
  198.  
  199.     endcase
  200.  
  201.     endswitch
  202.  
  203. endproc
  204.  
  205. ;***
  206. ;***    end of pcblogon.was
  207. ;***
  208.